﻿using Client.TopLevel;

using System;
using System.Collections;
using System.Windows.Forms;

namespace PersApp
{
    public partial class ListForm : Form
    {
        private ListForm()
        {
            InitializeComponent();
        }

        public ListForm(IEnumerable enumerable, int select)
        {
            InitializeComponent();

            elementsList.DataSource = enumerable;
            elementsList.SelectedIndex = select;
        }

        private void elementsList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        public object getSelected()
        {
            return elementsList.SelectedItem;
        }
    }
}
